home *** CD-ROM | disk | FTP | other *** search
- property mys, mygroup, x, y, z, mywidth, myheight, xadd, yadd, zadd, rx, ry, rz, mymember
- global xoff, yoff, zoff, scale, grouper
-
- on beginSprite me
- set mys to the spriteNum of me
- set rx to 0
- set ry to 0
- set rz to 0
- set xadd to 0
- set yadd to 0
- set zadd to 0
- set mymember to the member of sprite mys
- set mywidth to the width of the member of sprite mys
- set myheight to the height of the member of sprite mys
- end
-
- on exitFrame me
- set rx to rx * 0.80000000000000004
- set ry to ry * 0.80000000000000004
- set rz to rz * 0.80000000000000004
- rotate(me)
- View_point(me)
- end
-
- on xfix me, gx
- set rx to gx
- end
-
- on yfix me, gy
- set ry to gy
- end
-
- on zfix me, gz
- set rz to gz
- end
-
- on plot me, tx, ty, tz
- set x to tx
- set y to ty
- set z to tz
- end
-
- on movepoint me, group, xamount, yamount, zamount
- case grouper of
- mygroup, 0:
- set xadd to xadd + xamount
- set yadd to yadd + yamount
- set zadd to zadd + zamount
- end case
- end
-
- on rotate me
- if rx = 0 then
- else
- set cr to cos(rx)
- set sr to sin(rx)
- set y2 to (y * cr) - (z * sr)
- set z2 to (y * sr) + (z * cr)
- set y to y2
- set z to z2
- end if
- if ry = 0 then
- else
- set cr to cos(ry)
- set sr to sin(ry)
- set x2 to (x * cr) + (z * sr)
- set z2 to (z * cr) - (x * sr)
- set x to x2
- set z to z2
- end if
- if rz = 0 then
- else
- set cr to cos(rz)
- set sr to sin(rz)
- set x2 to (x * cr) - (y * sr)
- set y2 to (y * cr) + (x * sr)
- set x to x2
- set y to y2
- end if
- end
-
- on View_point me
- set z1 to z + zoff + zadd
- set xp to (x + xadd) * scale / z1
- set yp to (y + yadd) * scale / z1
- set the locH of sprite mys to xp + xoff
- set the locV of sprite mys to yoff - yp
- set the width of sprite mys to mywidth * scale / z1
- set the height of sprite mys to myheight * scale / z1
- end
-